package org.tio.sitexxx.service.service.qj;

import com.jfinal.kit.Kv;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.SqlPara;
import org.tio.sitexxx.service.model.main.Design;
import org.tio.sitexxx.service.vo.Const;


public class DesignService {
    public static final DesignService me = new DesignService();
    final Design dao = new Design().dao();
    public Design getDesignByQuestion(Kv kv){
        SqlPara sqlPara =   Db.use(Const.Db.TIO_SITE_MAIN).getSqlPara("design.getDesignByQuestion",kv);
        return dao.findFirst(sqlPara);
    }


    public Design getDesignById(Kv kv) {
        SqlPara sqlPara =   Db.use(Const.Db.TIO_SITE_MAIN).getSqlPara("design.getDesignById",kv);
        return dao.findFirst(sqlPara);
    }

    public int update(Design design){
        if(design.update())
            return 1;
        return 0;
    }
}
